name: Manual test

on:
    workflow_dispatch:
        inputs:
            test:
                description: "Array of tests to run, such as [11,12]"
                default: "['04']"
                required: true
            container:
                type: choice
                description: 'distro'
                default: 'fedora'
                options:
                    - "fedora"
                    - "arch"
                    - "debian"
                    - "opensuse"
                    - "gentoo"

jobs:
    test:
        runs-on: ubuntu-latest
        timeout-minutes: 45
        strategy:
            matrix:
                test: ${{ fromJSON(inputs.test) }}
        container:
            image: ghcr.io/dracutdevs/${{ inputs.container }}
            options: "--privileged -v /dev:/dev"
        steps:
            -   name: "Checkout Repository"
                uses: actions/checkout@v1
                with:
                    fetch-depth: 0
            -   name: "${{ inputs.container }} ${{ matrix.test }}"
                run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
